<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>01_弹性布局入门</title>
    <style>
        .container{
            background-color: lightgreen;
            /*给父容器使用弹性布局*/
            display: flex;
            /*主轴方向*/
            flex-direction: row-reverse;/*行模式反转*/
            flex-direction: column;/*列模式*/
            flex-direction: column-reverse;/*列模式反转*/
            flex-direction: row;/*行模式*/
            /*设置子项目是否换行*/
            /*默认：当父容器空间不足时，子项目会压缩自己也不会换行*/
            width: 500px;
            flex-wrap: nowrap;
            flex-wrap: wrap;/*也可以设置换行*/
        }
        .item{
            width: 100px;
            height: 100px;
            background-color: lightcoral;
            border: 3px solid orange;
            font-size: 45px;
        }
    </style>
</head>
<body>
    <!--弹性布局是父子结构，父元素称为"容器"，子元素称为"项目"-->
    <div class="container">
        <div class="item">1</div>
        <div class="item">2</div>
        <div class="item">3</div>
        <div class="item">4</div>
        <div class="item">5</div>
        <div class="item">6</div>
        <div class="item">7</div>
    </div>
</body>
</html>